﻿
// Condition: 2. Write a method GetMax() with two parameters that returns the bigger of two integers.
//               Write a program that reads 3 integers from the console and prints the biggest of them
//               using the method GetMax().


using System;



class GetMax

{
    // method that find bigger than two numbers.
    static int MaxNumber (int num1, int num2)
    {
        int max = num1;
        if (num2>num1)
        {
            max = num2;
            return max;
        }
        return max;
    }


    static void Main(string[] args)
    {
        Console.Write("Enter first integer: ");
        int firstnum = int.Parse(Console.ReadLine());
        Console.Write("Enter second integer: ");
        int secondnum = int.Parse(Console.ReadLine());
        Console.Write("Enter third integer: ");
        int thirdnum = int.Parse(Console.ReadLine());

        // variable Max use MaxNumber method twice to find bigger number out of three. 
        int Max = MaxNumber(MaxNumber(firstnum, secondnum), thirdnum);

        Console.WriteLine("The maximul number between {0}, {1} and {2} is: {3}",firstnum,secondnum,thirdnum,Max);

    }
}

